#include "Element_data.h"
#include "Link_list.h"

Elenemt_data stu_1[10] = 
{
    {.id = 1 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "唐三"},
    {.id = 2 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "小舞"},
    {.id = 3 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "罗峰"},
    {.id = 4 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "沈欣"},
    {.id = 5 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "萧炎"},
    {.id = 6 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "萧熏儿"},
    {.id = 7 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "叶辰"},
    {.id = 8 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "柳如烟"},
};
Elenemt_data stu_2[10] = 
{
    {.id = 1 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "小帅"},
    {.id = 2 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "小美"},
    {.id = 3 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "卡拉米"},
    {.id = 4 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "大壮"},
    {.id = 5 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "德玛西亚"},
    {.id = 6 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "后羿"},
    {.id = 7 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "太阳神"},
    {.id = 8 , .age = 18 ,.sco = 89 , .sex = "男" , .name = "阿波罗"},
};

int main(int argc, char const *argv[])
{
    // 初始化 
    Link_list * L1 = init_link_list();
    Link_list * L2 = init_link_list();
    // 插入
    for (int i = 0; i < 7; i++)
    {
       insert_node(  L1 ,  stu_1[i] , i);
       insert_node(  L2 ,  stu_2[i] , i);
    }
    
    Link_list * L3 = merge_link_lists(L1 , L2);

    // 遍历查看
    puts("=============================");
    print_link_list(L1);
    puts("=============================");
    clear_link_list(L2);  //清空操作
    print_link_list(L2);
    puts("=============================");
    print_link_list(L3);

    // 查找 
    find_node_id(L1 , 5);
    find_node_name(L1);
    // 释放链表
    free_link_list(&L1);
    free_link_list(&L2);
    free_link_list(&L3);
    return 0;
}

